<script>
export default {
  onLaunch: function () {
    console.log("App Launch");
	// 获取网络信息
	uni.getNetworkType({
		success: function (res) {
			console.log("获取当前网络")
			if(res.networkType==="none"){
				uni.showToast({
					title:"请先连接网络",
					icon:"none",
					duration:2000
				})
			}
		}
	});
	uni.onNetworkStatusChange(function (res) {
		console.log("监听当前网络")
		if(res.networkType==="none"){
			uni.showToast({
				title:"请先连接网络",
				icon:"none"
			})
		}
	});
  
  // 获取是否版本需要更新
  // #ifdef APP-PLUS  
  plus.runtime.getProperty(plus.runtime.appid, function(widgetInfo) {  
      uni.request({  
          url: 'http://www.example.com/update/',  
          data: {  
              version: widgetInfo.version,  
              name: widgetInfo.name  
          },  
          success: (result) => {  
              var data = result.data;  
              if (data.update && data.wgtUrl) {  
                  uni.downloadFile({  
                      url: data.wgtUrl,  
                      success: (downloadResult) => {  
                          if (downloadResult.statusCode === 200) {  
                              plus.runtime.install(downloadResult.tempFilePath, {  
                                  force: false  
                              }, function() {  
                                  console.log('install success...');  
                                  plus.runtime.restart();  
                              }, function(e) {  
                                  console.error('install fail...');  
                              });  
                          }  
                      }  
                  });  
              }  
          }  
      });  
  });  
  // #endif
  
  },
  onShow: function () {
    console.log("App Show");
  },
  onHide: function () {
    console.log("App Hide");
  },
  onLoad() {
  	
  }
};
</script>

<style>
/*每个页面公共css */

/* 导入 uni.css icon.css amimate.css */
@import url("./common/uni.css");
@import url("./common/icon.css");
@import url("./common/animate.css");
@import url("./common/style.css");
scroll-view ::-webkit-scrollbar {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
  -webkit-appearance: none;
  background: transparent;
}

</style>
